READ File Format

The READ function processes ASCII text records containing a mixture of
time tag fields (i.e.  the independent variable's value), one or more
data fields, and optional comments.  The carriage return character is
used as a record separator and spaces, commas, tabs, or comments are
used as field separators within records.

Comments are any string of characters (except '}') enclosed between a
'{' and a '}' or between pairs of double quote characters ("). 
Comments may appear anywhere within the file except between the
characters of a time tag or data field; i.e.  if a data field is e.g. 
'12' then a comment should not appear between the '1' and the '2'. 
Comments may be continued across records but should not, in this case,
appear between time tag or data fields.
+
An example comment is:
    {Entry   High   Low   Close   Date     Time}

The first field in a record (i.e.  the first field on the line
following a carriage return) is considered to be the time tag for all
subsequent values in the record.  Time tag fields should be in
increasing order.  All fields following the time tag are data fields
until another carriage return is encountered.  For example,

      1.2     4E1     2    3.625   7/7/86  13:45:22.5<CR><LF>
where:
     1.2                is the time tag.
     4E1, 2 and 3.625   are numeric data fields.
     7/7/86             is a date data field.
     13:45:22.5         is a time data field.

Time tag and data fields may have any of the formats that constants
may have, except the leading '#' character must not be used (see
Constants topic).
+
When processing a file whose records contain multiple data fields on
the same line, multiple READ function calls must be used; one READ call
for each data field.  These READ calls may be grouped via the '&'
statement terminator, occur multiple times in an expression (e.g. READ+
READ), or a combination of both.  Each occurrence of a READ causes one
data value (time tag values do not count) to be read from the ASCII
file.  For example, to process an ASCII file containing records as in
the above example, the following statements might be employed:

          high = READ &  low = READ &   close = READ &
          quote_date = READ &  quote_time = READ;

The DAN algorithm could then go on to reference the files 'high',
'low', 'close', 'quote_date', and 'quote_time' in subsequent
statements.  See the PLOTSTOK and PLOTSPOT examples and use the text
editor to examine the data files used in these algorithms.
+
Since DAN performs a linear interpolation to determine the value of a
function at step times other than those explicitly given, it is not
necessary for time tag values to be evenly spaced between records (i.e. 
the difference between time tags for successive records does not have
to be a constant value).  Also, there is no requirement on the number
of records.

If the algorithm does not specify START or DUR values, the READ
function will automatically set these control values from the first
time tag in the file and the time span processed during input.  That
is, START is set to the first time tag, and DUR is set to the
difference between the last time tag found and the first time tag. 
These become the default values for subsequent processing.
+
Accepting OPER Input From A Text File
-------------------------------------

A less flexible, but still usable, way to enter data from a text file
is to use the I/O redirection facilities of DOS and the OPER predefined
variable.

In this method the user creates a text file containing just data values
(no time tags).  There must be one data value for each step time in the
processing algorithm and the data values must correspond to the even
spacing specified by the STEP value used in the algorithm.  Comments
are not allowed in this text file.

An algorithm is then created that references the OPER variable when
successive values from the text file are desired.
+
The user then invokes DAN  with the following command line:

       C>DAN algor_name <text_file

where `algor_name' is the name given to the algorithm file and
`text_file' is the file name of the data file.  Note that only one data
file can be input this way since I/O redirection only applies to one
file.  The `Suppress OPER Prompt' Execution Option is used to suppress
the message that is normally output when operator input is expected.

If the number of data points changes then the STEP and/or DUR values
must be changed in the algorithm.
